#include <bits/stdc++.h>
using namespace std;

#define LL long long
#define MAXN 50005

const int INF = 0x3fffffff;

int N;

LL T, p[MAXN], d[MAXN], t[MAXN];

set< pair<LL, int> > myset;

bool check(int range) {
    t[1] = 0LL;
    myset.clear();
    myset.insert(make_pair(0LL, 1));
    for (int i = 2; i <= N; i ++) {
        if (i <= range + 1) {
            pair<LL, int> q = *myset.begin();
            t[i] = q.first + d[i];
        } else {
            pair<LL, int> del = make_pair(t[i - range - 1], i - range - 1);
            myset.erase(del);
            pair<LL, int> q = *myset.begin();
            t[i] = q.first + d[i];
        }
        myset.insert(make_pair(t[i], i));
    }
    LL time_cost = t[N];
    if (time_cost <= T) {
        return true;
    } else {
        return false;
    }
}

int gao() {
    int l = 1, r = N - 1;
    while (r - l > 1) {
        int mid = (l + r) >> 1;
        if (check(mid)) {
            r = mid;
        } else {
            l = mid;
        }
    }
    if (check(l)) return l;
    if (check(r)) return r;
}

void work() {
    T -= (N - 1);
    for (int i = 1; i <= N - 1; i ++) {
        cin >> p[i];
    }
    for (int i = 2; i <= N - 1; i ++) {
        cin >> d[i];
    }
    int q = gao();
    int cost = INF;
    for (int i = q; i <= N - 1; i ++) {
        cost = min(cost, (int)p[i]);
    }
    cout << cost << endl;
}

int main() {
#ifndef __SKT__
    freopen("journey.in", "r", stdin);
    freopen("journey.out", "w", stdout);
#else
   // freopen("in", "r", stdin);
#endif
    ios::sync_with_stdio(false);
    while (cin >> N >> T) {
        work();
    }
    return 0;
}
